
import { _decorator, Component, Node, Vec2 } from 'cc';
import { BulletOrigin } from './BulletOrigin';
import { CEventName } from '../FightControl';
import { BulletManager, bulletManger } from './BulletManager';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = BulletNormal
 * DateTime = Tue May 09 2023 00:49:49 GMT+0800 (GMT+08:00)
 * Author = guoxun
 * FileBasename = BulletNormal.ts
 * FileBasenameNoExtension = BulletNormal
 * URL = db://assets/script/fight/bullet/BulletNormal.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */

@ccclass('BulletNormal')
/**
 * 最简单的子弹类型 走直线 出框后隐藏
 */
export class BulletNormal extends BulletOrigin {
    protected onLoad(): void {
        super.onLoad();
    }

    MoveFinish() {
        this.node.active = false;
        BulletManager.Instance<BulletManager>().normalBulletPool.put(this.node);
    }

    InitLtPoint() {
        super.InitLtPoint();
    }

    InitV2Initial(point: Vec2): void {
        super.InitV2Initial(point);
        this.mV2Initial = point;
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
